<?php
declare (strict_types=1);

namespace app\admin\validates;

use think\Validate;

/**
 * ScanBag验证器
 */
class ScanBagValidate extends Validate
{
    /**
     * 验证规则
     * @var array
     */
    protected $rule = [
        'id' => 'require|number',
        'name' => 'require|max:255',
        'redirect_uri' => 'require|max:255',
        'jump_uri' => 'require|max:255',
        'mini_name' => 'require|max:64',
        'mini_username' => 'require|max:64',
        'mini_appid' => 'require|max:64|alphaNum',
        'mini_secret' => 'require|max:64|alphaNum',
        'mini_link' => 'require|max:255',
        'mini_qrcode' => 'require|max:255',
        'mini_advert' => 'require|array',
        'third_official' => 'require|number',
        'third_mini' => 'require|number',
        'remark' => 'require|max:255',
        'location_limit' => 'require|number',
    ];

    /**
     * 验证场景
     * @var array
     */
    protected $scene = [
        'edit' => ['id', 'redirect_uri','name' ,'jump_uri', 'mini_name', 'mini_username', 'mini_appid', 'mini_secret', 'mini_link',
            'mini_qrcode', 'mini_advert', 'third_official', 'third_mini', 'remark','location_limit'],
    ];


}